#!/bin/bash

# create group if not exists 
create_group() {
	egrep "^$1" /etc/group >& /dev/null  
	if [ $? -ne 0 ]; then
		groupadd $1
	fi 
}
create_group sshd
/usr/sbin/useradd -u 66 -g sshd -c "SSH daemon" -d /var/lib/sshd -s /sbin/nologin -m sshd


echo "root:1" | /usr/sbin/chpasswd || echo "root passwd set error !!!"
HOSTNAME=uos
echo "${HOSTNAME}" | tee /etc/hostname

cat > /etc/hosts << EOF
127.0.0.1       localhost
127.0.0.1       ${HOSTNAME}

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF
